package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.CollectionsMapper;
import com.education.wisdom.pojo.Collections;
import com.education.wisdom.service.ICollectionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 收藏 服务层实现
 *
 * @author ruoyi
 * @date 2018-11-10
 */
@Service
public class CollectionsServiceImpl implements ICollectionsService {
    @Autowired
    private CollectionsMapper collectionMapper;

    /**
     * 查询收藏信息
     *
     * @param szId 收藏ID
     * @return 收藏信息
     */
    @Override
    public Collections selectCollectionById(String szId) {
        return collectionMapper.selectCollectionById(szId);
    }

    /**
     * 查询收藏列表
     *
     * @param collection 收藏信息
     * @return 收藏集合
     */
    @Override
    public List<Collections> selectCollectionList(Collections collection) {
        return collectionMapper.selectCollectionList(collection);
    }

    /**
     * 新增收藏
     *
     * @param collection 收藏信息
     * @return 结果
     */
    @Override
    public int insertCollection(Collections collection) {
        return collectionMapper.insertCollection(collection);
    }

    /**
     * 修改收藏
     *
     * @param collection 收藏信息
     * @return 结果
     */
    @Override
    public int updateCollection(Collections collection) {
        return collectionMapper.updateCollection(collection);
    }

    /**
     * 删除收藏对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCollectionByIds(String ids) {
        return collectionMapper.deleteCollectionByIds(Convert.toStrArray(ids));
    }

    @Override
    public int selectcount(Map<String, Object> map) {
        return collectionMapper.selectcount(map);
    }

}
